<template>
  <div class="music-list">
    <div class="listHeader">
      <div class="h-left">
        <slot name="icon"></slot>
        <slot name="title"></slot>
      </div>
      <div class="h-right">
        <slot name="more"></slot>
      </div>
    </div>
    <div class="listContent">
      <div class="item" v-for="item of Songs" :key="item.id">
        <img :src="item.coverImgUrl" alt="" @click="goDetail(item.id)" />
        <p>{{ item.name }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    Songs: {
      type: Array,
    },
  },
  methods: {
      goDetail(id){
        //   console.log(id);
          this.$router.push(`/music/detail/${id}`)
      },
  },
};
</script>

<style scoped>
.music-list{
    padding: 0.3rem;
}
.listHeader {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-top: 1px solid #f5f5f5;
}
.listContent {
  display: flex;
  justify-content: space-between;
}
.listContent .item {
  width: 2.8rem;
}
.listContent .item img {
  width: 100%;
  margin-bottom: 0.2rem;
}
.h-left{
    display: flex;
    align-items: center;
}
.h-left img{
    margin-right: 0.2rem;
}
</style>